import * as PIXI from 'pixi.js'
import { accessoriesSprite } from '@renderer/utils/bundle'

export const closeLantern = async (): Promise<Record<string, PIXI.Container<PIXI.ContainerChild>>> => {
  const container = new PIXI.Container()
  const closeContainer = new PIXI.Container() // 按钮容器
  const closeLanternSprite = await accessoriesSprite('close_lantern')
  const closeLanternHighlightSprite = await accessoriesSprite('close_lantern_highlight')
  closeContainer.addChild(closeLanternSprite)
  closeContainer.addChild(closeLanternHighlightSprite)
  const tasselsSprite = await accessoriesSprite('tassels')

  closeLanternSprite.anchor.set(0.5)
  closeLanternHighlightSprite.anchor.set(0.5)
  tasselsSprite.anchor.set(0.5)
  tasselsSprite.position.set(5, (closeContainer.height + tasselsSprite.height) / 2 - 10)
  container.addChild(closeContainer)
  container.addChild(tasselsSprite)
  return {
    container,
    closeContainer,
  }
}
